package org.xxmi.interview;

import java.io.Serializable;

public class Person  implements Cloneable {

    public Person(){}
    public Person(String name){
        this.name = name;
    }
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                '}';
    }

    public static void main(String[] args) {
        Person p1 = new Person("张三");
        Person p2 = p1;
        System.out.println(p1);
        System.out.println(p1);
        System.out.println("============");

        try {
            Person p3 = (Person) p1.clone();
            System.out.println(p3);
            p3.setName("李四");
            System.out.println(p1);
            System.out.println(p2);
            System.out.println(p3);
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }

        Person p4 = new Person("11");
        Person.Draw dw = p4.new Draw();
    }

    private String tname = "ceshi";

    private void testFn(){

    }

    public Person getPeople(){
        class People extends Person{
            public void ptest(){
                System.out.println("ptest");
            }
        }
        return new People();
    }

    class Draw{
        private String tname ="nbn";
        public void test1(){
            testFn();
            tname = "修改";
            Person.this.tname = "xiugai";
        }
    }
    static int age =10;
    int count = 10;
    static class Yuan{
        public void test001(){
            age = 101;
            System.out.println(age);
        }
    }

    public void cao(){

    }

}



















